package com.ssm.admin.service.impl;

import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ssm.common.utils.PageUtils;
import com.ssm.common.utils.Query;

import com.ssm.admin.dao.SsmActivityDao;
import com.ssm.admin.entity.SsmActivityEntity;
import com.ssm.admin.service.SsmActivityService;


@Service("ssmActivityService")
public class SsmActivityServiceImpl extends ServiceImpl<SsmActivityDao, SsmActivityEntity> implements SsmActivityService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String key = (String) params.get("key");
        IPage<SsmActivityEntity> page = this.page(
                new Query<SsmActivityEntity>().getPage(params),
                new QueryWrapper<SsmActivityEntity>().like(StringUtils.isNotBlank(key),"at_name",key)
        );

        return new PageUtils(page);
    }

}